Ext.define('AM.controller.BaseEditController', {
	extend : 'Ext.app.Controller',
	models : [],
	views : [ 'base.Edit' ],
	init : function() {
		this.control({
			'baseedit button[action=save]' : {
				click : this.save
			}
		});
		this.callParent(arguments);
	},
	save : function(button) {
		console.log('BaseEditController save');
		var win = button.up('window');
		var store = this.getStore(win.storeName);
		var form = win.down('form');
		var record = form.getRecord(); 
		var values = form.getValues(false,false,false,true);
		record.set(values);
		win.close();
		console.log(record);
		store.add(record);
		store.sync();
	}
});